<template>
	<view class="padding">
		<view class="boxconten box" v-for="(item,index) in hospital" :key="index" @click="addressclick(item.id)">
			<view class="img">
				<img :src="item.img" style="height: 280rpx;" mode="aspectFit">
			</view>
			<view class="texts">
				<view class="text">
					<span class="name">{{item.name}}</span>
					<span class="address">{{item.address}}</span>
				</view>
				<view class="jiantou">
					<u-icon name="arrow-right" color="#2979ff" size="50"></u-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// screenHeight: getApp().globalData.screenHeight,
				hospital: [{
						name: '西宁大堡子卫生院',
						address: '青海省西宁市城北区柴达木路564',
						img: '/static/xzfx.jpg',
						id:'001'
					},
					{
						name: '西宁大堡子卫生院',
						address: '青海省西宁市城北区柴达木路564',
						img: '/static/snfx.jpg',
						id:'002'
					}
				]
			}
		},
		onLoad() {

		},
		computed: {

		},
		methods: {
			bindmarkertap() {
				// 打开的点击事件，传经纬度和地点名
				console.log('走的这里', '徐州复兴眼科医院');
				wx.openLocation({
					latitude: 34.25059, // 纬度
					longitude: 117.183511, // 经度
					name: '西宁大堡子卫生院', // 地址名称
					address: '青海省西宁市城北区柴达木路564', // 详细地址
					success: function(r) {
						console.log(r)
					},
					fail: function(res) {
						console.log('拉起失败啦', res)
					}
				})
			},
			addressclick(id){
				console.log("医院地址id",id)
				this.bindmarkertap()
			}
		}
	}
</script>

<style>
	@import './navigation.css'
</style>